package com.example.websocket.pattern.creational.factory.abstractFactoryPattern;

import com.example.websocket.pattern.creational.factory.abstractFactoryPattern.line.color.Color;
import com.example.websocket.pattern.creational.factory.abstractFactoryPattern.line.color.Green;
import com.example.websocket.pattern.creational.factory.abstractFactoryPattern.line.color.Red;
import com.example.websocket.pattern.creational.factory.abstractFactoryPattern.line.color.Yellow;
import com.example.websocket.pattern.creational.factory.abstractFactoryPattern.line.shape.Shape;

public class ColorFactory extends AbstractFactory {
    @Override
    public Shape getShape(String shapeType) {
        return null;
    }

    @Override
    public Color getColor(String colorType) {
        if (colorType == null) {
            return null;
        } else if (colorType.contains("RED")) {
            return new Red();
        } else if (colorType.contains("GREEN")) {
            return new Green();
        } else if (colorType.contains("YELLOW")) {
            return new Yellow();
        }
        return null;
    }
}
